import Vue from "vue";
import jsonp from "vue-jsonp";

Vue.use(jsonp);

const urls = {
    multigetUrl: "https://mce.mogucdn.com/jsonp/multiget/3",
    guessLikeUrl: "https://list.mogujie.com/search",
    classCommodityUrl: "https://mce.mogucdn.com/jsonp/get/3",
    classMiniWallUrl: "https://list.mogujie.com/search",
    detailsCommentUrl: "https://rate.mogujie.com/h5/rate/jsonp/x6.rate.ratelist/v1",
}

// 首页数据接口
const multigetData = function(arg) {
    return Vue.jsonp(urls.multigetUrl, arg);
}

// 猜你喜欢
const guessLikeData = function(arg) {
        return Vue.jsonp(urls.guessLikeUrl, arg);
    }
    // 分类页 右侧分类 
const classCommodity = function(arg) {
        return Vue.jsonp(urls.classCommodityUrl, arg);
    }
    // 分类页 右侧产品列表和排序
const classMiniWall = function(arg) {
        return Vue.jsonp(urls.classMiniWallUrl, arg);
    }
    // 详情页 评论获取
const detailsComment = function(arg) {
    return Vue.jsonp(urls.detailsCommentUrl, arg);
}





export default {
    multigetData,
    guessLikeData,
    classCommodity,
    classMiniWall,
    detailsComment,
}